//-- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2017 the OpenProject Foundation (OPF)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2017 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++

$ng-modal-padding:       3em
$ng-modal-background:    $body-background
$ng-modal-close-color:   $light-gray
$ng-modal-image-height:  135px
$ng-modal-image-width:   $ng-modal-image-height

// Based on code by Kasper Mikiewicz

.ng-modal-open
  overflow: hidden

.ng-modal-window
  // overlay
  +position(fixed, 0 0 0 0)
  background: rgba(0, 0, 0, 0.5)
  text-align: left
  z-index: 10000

  .ng-modal-bg
    +position(absolute, 0 0 0 0)
    cursor: pointer

  &.ng-enter
    +transition(opacity 0.25s ease)
    opacity: 0
    visibility: hidden

  &.ng-enter.ng-enter-active
    opacity: 1
    visibility: visible

    .ng-modal-inner
      top: 0

  &.columns-modal
    .ng-modal-inner
      overflow: visible

.ng-modal-inner
  +transition(opacity 0.25s ease)
  background: $ng-modal-background
  margin: auto
  max-height: 95%
  position: relative
  width: 95%
  padding: $ng-modal-padding / 2
  margin-top: 5%
  overflow-y: auto
  overflow-x: hidden
  //+media($medium-screen)
  //padding: $ng-modal-padding
  //width: 50%
  //max-height: 50%
  //margin-top: 10em

  //+media($large-screen)
  width: 40%

  .modal-header
    padding: 0
    i
      float: right
      cursor: pointer

  .select2-container
    margin: 0 0 10px 0


  #modal-sorting
    min-height: 120px
    .select2-container
      float: left
      margin-right: 20px
      margin-bottom: 0px
      @media(min-width: 1801px)
        width: 300px
      @media(max-width: 1800px)
        width: 280px
      @media(max-width: 1400px)
        width: 230px
      @media(max-width: 1100px)
        width: 160px
      @media(max-width: 800px)
        width: 120px
    label.option-label
      float: left
      margin-right: 20px
      input
        margin-top: 0px

  .columns-modal-content
    margin-bottom: 15px
    label
      display: inline
      padding-right: 30px

ul.export-options
  margin: 0
  padding: 20px 0
  list-style-type: none
  li
    margin: 0 0 30px 0
    text-align: center
    display: inline-block
    min-width: 32%
    a
      cursor: pointer
      text-decoration: none
      color: $body-font-color
      font-weight: normal
      &:hover, &:active
        text-decoration: none
        color: $body-font-color
      span.export-label
        display: block
        padding: 10px 0 0 0

// Legacy styles for jQuery UI modal

.ui-dialog.ui-widget
  overflow: visible

// remove iframe border explicitly because Firefox does add it for some reason
#modalIframe
  border: 0


//
// Styles for the new modal used for example for onboarding or the registration form
//

// Align ngDialog's close button
.modal-wrapper .ngdialog-close,
.ngdialog-theme-openproject .ngdialog-close
  @include varprop(line-height, header-height)
  @include varprop(color, header-item-font-color)

.modal--header
  display: flex
  align-items: center
  @include varprop(background-color, header-bg-color)
  height: $header-height
  padding-left: 1.5rem
  border-bottom-style: solid
  @include varprop(border-bottom-width, header-border-bottom-width)
  @include varprop(border-bottom-color, header-border-bottom-color)

  h2
    @include varprop(color, header-item-font-color)
    padding: 0
    font-size: 1.25rem
    line-height: $header-height

  .avatar,
  .icon-context
    margin-right: 0.5rem

.modal--main
  margin: 1em 0
  padding: 0 1.5rem

.modal--footer
  margin: 1em 0
  padding: 0 1.5rem
